import Axios from '@/utils/request'
export const getArticles = (channelId, timestamp) => {
  return Axios({
    method: 'GET',
    url: '/app/v1_1/articles',
    params: {
      channel_id: channelId,
      timestamp: timestamp,
      with_top: 1
    }
  })
}
// 处理不感兴趣的文章即删除文章
/**
 * 对指定的id的文章 不感兴趣
 * @param {*} articleId 文章编号
 */
export const dislikeArticle = articleID => {
  return Axios({
    method: 'POST',
    url: '/app/v1_0/article/dislikes',
    data: {
      target: articleID
    }
  })
}
// 根据举报类型举报文章
/**
 * 举报文章
 * @param {*} articleId 文章编号
 * @param {*} type 举报类型编号
 */
export const reportArticle = (articleId, type) => {
  return Axios({
    method: 'POST',
    url: '/app/v1_0/article/reports',
    data: {
      target: articleId,
      type
    }
  })
}
/**
 * 根据文章编号来获取文章详情
 * @param {*} id 文章编号
 */
export const getArticle = id => {
  return Axios({
    method: 'GET',
    url: '/app/v1_0/articles/' + id
  })
}
